package com.xiaomo.gitee.datamanager.dto.menu;

import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

@Data
@Schema(
        name = "数据管理菜单模型",title = "数据管理菜单模型"
)
public class DataMenuDTO implements Serializable {

    @Schema(
            title = "id",
            description = "栏目ID",
            format = "number"
    )
    private Integer id;

    @Schema(
            title = "name",
            description = "栏目名称",
            format = "string"
    )
    private String name;

    @Schema(
            title = "description",
            description = "栏目描述",
            format = "string"
    )
    private String description;

    @Schema(
            title = "path",
            description = "访问路径",
            format = "string"
    )
    private String path;

    @Schema(
            title = "icon",
            description = "图标名称(Element Plus)",
            format = "string"
    )
    private String icon;

    @Schema(
            title = "children",
            description = "子栏目,类型为数组",
            implementation = DataMenuDTO.class
    )
    private List<DataMenuDTO> children;

    @JsonIgnore
    @JSONField(serialize = false)
    @Schema(
            hidden = true
    )
    private String perm;

    @JSONField(serialize = false)
    @JsonIgnore
    @Schema(
            hidden = true
    )
    private Integer parentId;

    @Serial
    private static final long serialVersionUID = 1L;

}
